package com.zhaoxi.boot.demo.bootlesson1.controller.user;

import com.zhaoxi.boot.demo.bootlesson1.config.Friends;
import com.zhaoxi.boot.demo.bootlesson1.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author ZXM
 * @description TODO
 * @date 2024/3/3 21:29
 */
@RestController
public class UserController {
    @Value("${names1:default}")
    private String names1;

    @Value("${names2:default}")
    private String names2;

    @Value("${env.name}")
    private String name;

    @Autowired
    private Friends friends;

    @Autowired
    private User user;
    @GetMapping("/index")
    public String index(){
//        return "this is first springboot application";
        return "你好，spring";
    }
    @GetMapping("/names")
    public String names(){
        System.out.println(names1);
        System.out.println(names2);
        return "OK";
    }
    @GetMapping("/maps")
    public String maps(){
        System.out.println(friends);
        return "OK";
    }
    @GetMapping("/user")
    public String user(){
        System.out.println(user);
        return "OK";
    }
    @GetMapping("/name")
    public String name(){
        System.out.println(name);
        return "OK";
    }
}
